package cn.tedu.micro.demo.order.controller;


import cn.tedu.micro.demo.common.pojo.protocol.JsonResult;
import cn.tedu.micro.demo.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    @PostMapping("/order/create")
    public JsonResult<String> addOrder(Integer gunId, Integer userId){
        log.debug("创建订单，枪支ID：{}，订单ID：{}",gunId,userId);
        String bullId = orderService.addOrder(gunId,userId);
        return JsonResult.ok("",bullId);

    }
}
